<template>
  <view>
    <u-sticky bgColor="#fff">
      <u-tabs :list="list1"></u-tabs>
    </u-sticky>
  </view>
</template>

<script>
import { init_frontendList } from "@/api/node.js";
export default {
  data() {
    return {
      isEmpty: false,
      isRoll: 0,
      evaluateList: [],
      buyerList: [],
      list: ["未付款", "待评价", "已付款"],
      // 或者如下，也可以配置keyName参数修改对象键名
      // list: [{name: '未付款'}, {name: '待评价'}, {name: '已付款'}],
      current: 1,
    };
  },
  onLoad(option) {
    this.goodId = option.id;
    this.getData();
  },
  methods: {
    async getData() {
      let arr = [];
      const params = {
        goodsId: this.goodId,
        // pageNum: this.pageNum,
        // pageSize: this.pageSize,
        userId: uni.getStorageSync("user").userId,
      };
      const res = await init_frontendList(params);

      this.isEmpty = res?.list.length == 0;
      this.isRoll = res?.list.length == res?.total;
      this.total = res?.total;
      res?.list?.forEach((e) => {
        arr.push({
          ...e,
          imgUrl: e?.imgs?.split(","),
        });
      });
      this.evaluateList = arr;
      this.buyerList = arr.filter((v) => v?.buyingHomeShow == 1);
      console.log(
        "this.buyerList,evaluateList :>> ",
        this.buyerList,
        this.evaluateList
      );
    },
  },
};
</script>

<style lang="less" scoped></style>
